#ifndef MATERIAL_H_INCLUDED
#define MATERIAL_H_INCLUDED

#include "Color.h"
#include <string>
#include "Texture.h"

/***
@file
@author Fabrice Aubert
@brief représentation matériel simple (phong, refraction, reflexion)
**/

namespace prog3d {

class Material {
  std::string _name;
	Color ka,kd,ks;
	double _alpha;
	double s; // shininess
	double _descartes;
	double att_refrac,att_reflex;
	double _milieu;
	Texture *_mapKd;
	public:
	/// constructeur par défaut
	Material();
	/// destructeur
	virtual ~Material();

	///
	void ambient(const Color &a);
	void diffuse(const Color &d);
	void specular(const Color &s);
	void shininess(double s);

	///
	const Color &ambient() const;
	const Color &diffuse() const;
	const Color &specular() const;
	double shininess() const;

	double alpha() const;
	void alpha(const double a);

	std::string name() const;
	void name(const std::string &name);

	///
	void setDescartes(double n);
	void setAttReflexion(double alpha);
	void setAttRefraction(double alpha);
	void setMilieu(double m);
	double milieu() const;

	///
	double descartes() const;
	double attReflexion() const;
	double attRefraction() const;

	void setGL();
	void activeTexture();

	void mapDiffuse(Texture *t);
	Texture *mapDiffuse();

  friend std::ostream& operator <<(std::ostream &s,const Material &q);

};

}


#endif // MATERIAL_H_INCLUDED
